//
//  ViewController.m
//  11105
//
//  Created by student on 16/2/29.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0,[UIImage imageNamed:@"bg"].size.width , [UIImage imageNamed:@"bg"].size.height)];
    imageView.image = [UIImage imageNamed:@"bg"];
    [self.scrollView addSubview:imageView];
    self.scrollView.contentSize = [UIImage imageNamed:@"bg"].size;
    self.scrollView.scrollEnabled = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)Leftpressed:(id)sender
{
    CGPoint offset=self.scrollView.contentOffset;
    offset.x+=10;
    self.scrollView.contentOffset=offset;
}
- (IBAction)leftHigh:(id)sender {
    CGPoint offset=self.scrollView.contentOffset;
    offset.x+=10;
    offset.y+=10;
    self.scrollView.contentOffset=offset;
}
- (IBAction)leftDown:(id)sender {
    CGPoint offset=self.scrollView.contentOffset;
    offset.x+=10;
    offset.y-=10;
    self.scrollView.contentOffset=offset;
}
- (IBAction)high:(id)sender {
    CGPoint offset=self.scrollView.contentOffset;
    offset.y+=10;
    self.scrollView.contentOffset=offset;
}
- (IBAction)down:(id)sender {
    CGPoint offset=self.scrollView.contentOffset;
    offset.y-=10;
    self.scrollView.contentOffset=offset;
}
- (IBAction)right:(id)sender {
    CGPoint offset=self.scrollView.contentOffset;
    offset.x-=10;
    self.scrollView.contentOffset=offset;
}
- (IBAction)rightHigh:(id)sender {
    CGPoint offset=self.scrollView.contentOffset;
    offset.x-=10;
    offset.y+=10;
    self.scrollView.contentOffset=offset;

}
- (IBAction)rightDown:(id)sender {
    CGPoint offset=self.scrollView.contentOffset;
    offset.x-=10;
    offset.y-=10;
    self.scrollView.contentOffset=offset;

}

@end
